package com.googlecode.likesql.context;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;

/**
 * The SqlContext class represents a context which contains a SQL template and values.
 * 
 * @author Johny Huang
 *
 */
public interface SqlContext{
	
	/**
	 * Converts to a executable SQL.
	 * 
	 * @return executable SQL
	 */
	String getSql();
	
	/**
	 * Gets the SQL template.
	 * 
	 * @return SQL template
	 */
	String getTemplate();
	
	/**
	 * Converts to a PreparedStatement
	 * @return PreparedStatement
	 */
	PreparedStatement getPreStatement(Connection con) throws SQLException;
	
	/**
	 * Gets the value list.
	 * @return value list
	 */
	List getValueList();
}
